#include <LitStdAfx.h>
#include <LitInitialiser.h>

namespace Lit
{
	Initialiser::Initialiser( const Initialiser &rk ) : mName(rk.mName), mInitialised(rk.mInitialised){}
	Initialiser::Initialiser( const std::string &name ) : mName(name), mInitialised( false ){}
	Initialiser::~Initialiser( ){}

	const std::string &Initialiser::getName() const{ return mName; }

	void Initialiser::setInitialised( bool init ){ mInitialised = init ; }
	bool Initialiser::isInitialised( ) const{ return mInitialised; }
			
	void Initialiser::throwNotInit( )
	{
		if( !isInitialised() )
			throw Lit::InitialisationError( mName + " not initialised !", EXC_LOC );
	}
	void Initialiser::throwAlreadyInit( )
	{
		if( isInitialised() )
			throw Lit::InitialisationError( mName + " already initialised !", EXC_LOC );
	}
};